package ControlLayer;
import ModelLayer.OrderHistory;
import DBLayer.DBOrderHistory;
import java.util.ArrayList;

public class CtrOrderHistory {
    // <editor-fold defaultstate="collapsed" desc="Attributes & Constructors">
    private static CtrOrderHistory instance = null;
    DBOrderHistory dbOrderHistory = new DBOrderHistory();

    public CtrOrderHistory() {
    }
    // </editor-fold>

    // <editor-fold defaultstate="collapsed" desc="Methods">
    public static CtrOrderHistory getInstance() {
        if (instance == null) {
            instance = new CtrOrderHistory();
        }
        return instance;
    }

    public ArrayList<OrderHistory> getOrderHistoryList() {
        return dbOrderHistory.getOrderHistoryList();
    }

    public OrderHistory getOrderHistoryByID(int id) {
        return dbOrderHistory.getOrderHistoryByID(id);
    }

    public int addOrderHistory(OrderHistory orderHistory) {
        return dbOrderHistory.addOrderHistory(orderHistory);
    }

    public int updateOrderHistory(OrderHistory orderHistory, int id) {
        return dbOrderHistory.updateOrderHistory(orderHistory, id);
    }

    public void deleteOrderHistory(int id) {
        dbOrderHistory.deleteOrderHistory(id);
    }
    // </editor-fold>
}
